﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="BasicGame.Games"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BasicGame"
    xmlns:common="using:BasicGame.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.TopAppBar>
        <AppBar>
            <Button x:Name="btnHome" HorizontalAlignment="Left" Style="{StaticResource HomeAppBarBtnStyle}" IsEnabled="True" Click="btnHome_Click_1"/>
        </AppBar>
    </Page.TopAppBar>
    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}">
    	<Grid.Background>
    		<ImageBrush ImageSource="Assets/Images/Background.jpg" Stretch="UniformToFill"/>
    	</Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" Foreground="Black" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Game Title" Foreground="Black"  Style="{StaticResource PageHeaderTextStyle}"/>
            <Image x:Name="imgLogo" Margin="0,0,10,0" Grid.Column="1" HorizontalAlignment="Right" Width="234" Height="100" VerticalAlignment="Center" 
                   Source="/Assets/AppLogo.png"/>
        </Grid>
        <ScrollViewer x:Name="GameArea" Grid.Row="1" Style="{StaticResource HorizontalScrollViewerStyle}" >
            <Grid x:Name="Container" Margin="120,0,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="350"/>
                </Grid.ColumnDefinitions>
                <Grid Margin="0,20,20,20" Grid.Column="0" Opacity="0.3" MinWidth="500" Background="Gray">
                    <TextBlock Text="GAME AREA" FontSize="50" FontWeight="Bold" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                </Grid>
                <Grid Margin="0,20,20,20" Grid.Column="1" Background="#99FFFFFF">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="SCORE" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="27" Foreground="#FF003B57" Margin="20"/>
                    <TextBlock HorizontalAlignment="Left" Text="35976" FontWeight="ExtraLight" FontSize="44" Grid.Row="1" Margin="20,0,0,0" Foreground="Black"/>
                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Grid.Row="2" Text="TIME" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="27" Foreground="#FF003B57" Margin="20"/>
                    <TextBlock HorizontalAlignment="Left" Text="1:14:35" FontWeight="ExtraLight" FontSize="44" Grid.Row="3" Margin="20,0,0,0" Foreground="Black"/>
                    <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Grid.Row="4" Text="BEST TIME" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="27" Foreground="#FF003B57" Margin="20"/>
                    <ListBox Margin="20,0,0,0" Grid.Row="5">
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/male1.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:10:23" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/female1.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:11:28" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/male2.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:12:23" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/female2.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:10:23" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/male1.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:10:23" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                        <ListBoxItem>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="50" Height="50" Source="/Assets/Images/female1.jpg"/>
                                <TextBlock Text="Person1" Margin="10,10,0,0" FontSize="20"/>
                                <TextBlock Text="1:11:28" Margin="10,10,0,0" FontSize="20"/>
                            </StackPanel>
                        </ListBoxItem>
                    </ListBox>
                </Grid>
            </Grid>
        </ScrollViewer>
       
        <Grid x:Name="grdSnapView" Visibility="Collapsed" Grid.Row="0" Grid.RowSpan="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="110"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <Image x:Name="imgLogo1" Margin="10,0,10,0"  HorizontalAlignment="Left" Width="234" Height="100" VerticalAlignment="Top" 
                   Source="/Assets/AppLogo.png"/>
            </StackPanel>

            <TextBlock Grid.Row="0" Grid.RowSpan="2" FontSize="30" Text="Game paused. Switch to full screen to resume play" TextWrapping="Wrap" Foreground="Black" TextAlignment="Center"
                       VerticalAlignment="Center" />
        </Grid>
        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Container" Storyboard.TargetProperty="Margin">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="96,0,0,0"/>
                        </ObjectAnimationUsingKeyFrames>
                        
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="imgLogo" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="GameArea" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="grdSnapView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="imgLogo1">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<x:Double>200</x:Double>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="imgLogo1">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<x:Double>85</x:Double>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.VerticalAlignment)" Storyboard.TargetName="imgLogo1">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<VerticalAlignment>Center</VerticalAlignment>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="imgLogo1">
                        	<DiscreteObjectKeyFrame KeyTime="0">
                        		<DiscreteObjectKeyFrame.Value>
                        			<Thickness>46,25,10,0</Thickness>
                        		</DiscreteObjectKeyFrame.Value>
                        	</DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
